package com.swak.rpc.proxy;

import static com.swak.rpc.Constants.PROXY_KEY;

import com.swak.exception.RpcException;
import com.swak.registry.URL;
import com.swak.rpc.Invoker;
import com.swak.spi.Adaptive;
import com.swak.spi.SPI;

@SPI("javassist")
public interface ProxyFactory {

	@Adaptive({ PROXY_KEY })
	<T> T getProxy(Invoker<T> invoker) throws RpcException;

	@Adaptive({ PROXY_KEY })
	<T> Invoker<T> getInvoker(T proxy, Class<T> type, URL url) throws RpcException;
}
